perm filename MASTER[E,ALS] blob
sn#277786 filedate 1977-04-26 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 BEGIN
C00005 ENDMK
C⊗;
BEGIN
DEFINE ⊂="BEGIN",⊃="END",$="COMMENT";
INTEGER I,J,X,Y,Z;
INNTEGER ARRAY GUESS,CODE,BUF[0:4];
STRING READ;
PROCEDURE TELL;
⊂ OUTSTR('11&'11&"Computerized Master Mind"&'15&'12);
OUTSTR("You have 12 guesses as to the value of a random 5-digit octal number.
After each guess you will be told the number of Hits (the number of digits
that you have guessed corectly) and the number of times you assigned an
existing digit to a wrong position. Each digit in the random number and in
your guess is used but once, that is if the random number contained one 3, for
example, and you guess that there were 2 or more 3's you will be told 1.
Similarily if there were 2 or more 3's in the random number and one 3 in your
guess you will be told 1. You need not guess values for all 5 digits but may
use a space in place of any desired digit if you think that this will aid you.
End your guess with a CR.
Type ? instead of a number if you wish this explanation repeated."&'15&'12);
⊃;
TELL;
WHILE TRUE DO
⊂ "MASTER"
X←DAYTIM%100; X←X*771+54321;
FOR I←0 STEP 1 UNTIL 4 DO
⊂ CODE[I]←X MOD 8; X←X%7; ⊃;
OUTSTR("Now type your first guess."&'15&'12);
outstr("No. Guess Hits Wrong position"&'15&'12);
FOR K←1 STEP 1 UNTIL 12 DO
⊂ OUTSTR(CVS(K)&"*"&'11);
READ←INCHWL; J←1;
IF READ EQU "?" THEN ⊂ TELL; READ←INCHWL; ⊃;
FOR I←0 STEP 1 UNTIL 4 DO
⊂ GUESS[I]←CVASC(READ[J FOR 5]);
IF (GUESS[I]≥'60)∧(GUESS[I]≤'71) THEN GUESS[I]←GUESS[I]-60;
J←J+5;
⊃;